package rad.framework.mda.generator.template.maven;

import org.eclipse.uml2.uml.Model;
import rad.framework.mda.generator.util.*;

public class JBossPom
{
  protected static String nl;
  public static synchronized JBossPom create(String lineSeparator)
  {
    nl = lineSeparator;
    JBossPom result = new JBossPom();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<project>" + NL + "\t<modelVersion>4.0.0</modelVersion>" + NL + "\t<groupId>";
  protected final String TEXT_2 = "</groupId>" + NL + "\t<artifactId>";
  protected final String TEXT_3 = "</artifactId>" + NL + "\t<version>";
  protected final String TEXT_4 = "</version>" + NL + "\t<packaging>pom</packaging>" + NL + "\t<name>";
  protected final String TEXT_5 = "</name>" + NL + "\t<description>Master project for ";
  protected final String TEXT_6 = "</description>" + NL + "\t" + NL + "\t<modules>" + NL + "\t\t<module>";
  protected final String TEXT_7 = "</module>" + NL + "\t\t<module>";
  protected final String TEXT_8 = "</module>" + NL + "\t\t<module>";
  protected final String TEXT_9 = "</module>" + NL + "\t\t<module>";
  protected final String TEXT_10 = "</module>" + NL + "\t\t<module>";
  protected final String TEXT_11 = "</module>" + NL + "\t</modules>" + NL + "\t" + NL + "\t<project>" + NL + "\t\t<properties>" + NL + "\t\t\t<rad-framework.version>1.0</rad-framework.version>" + NL + "\t\t\t<seam.version>2.1.2</seam.version>" + NL + "\t\t\t<richfaces.version>3.3.0.GA</richfaces.version>\t<!-- 3.3.1.GA has issues with JSFUnit -->" + NL + "\t\t\t<maven.test.skip>true</maven.test.skip>" + NL + "\t\t\t<maven.test.failure.ignore>true</maven.test.failure.ignore>" + NL + "\t\t</properties>" + NL + "\t</project>" + NL + "\t" + NL + "\t<dependencies>" + NL + "\t\t<dependency>" + NL + "\t\t\t<groupId>rad-framework</groupId>" + NL + "\t\t\t<artifactId>rad-framework-commons</artifactId>" + NL + "\t\t\t<version>${rad-framework.version}</version>" + NL + "\t\t\t<scope>provided</scope>" + NL + "\t\t\t<exclusions>" + NL + "  \t\t\t\t<exclusion>" + NL + "   \t\t\t\t\t<artifactId>el-api</artifactId>" + NL + "   \t\t\t\t\t<groupId>javax.el</groupId>" + NL + "  \t\t\t\t</exclusion>" + NL + " \t\t\t</exclusions>" + NL + "\t\t</dependency>" + NL + "\t\t<dependency>" + NL + "\t\t\t<groupId>rad-framework</groupId>" + NL + "\t\t\t<artifactId>rad-framework-jboss-embedded</artifactId>" + NL + "\t\t\t<version>${rad-framework.version}</version>" + NL + "\t\t\t<scope>provided</scope>" + NL + "\t\t</dependency>" + NL + "\t</dependencies>" + NL + "\t" + NL + "\t<build>" + NL + "\t\t<defaultGoal>install</defaultGoal>" + NL + "\t\t<resources>" + NL + "\t\t\t<resource>" + NL + "\t\t\t\t<directory>src/main/resources</directory>" + NL + "\t\t\t\t<filtering>true</filtering>" + NL + "\t\t\t</resource>" + NL + "\t\t</resources>" + NL + "\t\t<testResources>" + NL + "\t\t\t<testResource>" + NL + "\t\t\t\t<directory>src/test/resources</directory>" + NL + "\t\t\t\t<filtering>true</filtering>" + NL + "\t\t\t</testResource>" + NL + "\t\t</testResources>" + NL + "\t\t<plugins>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-compiler-plugin</artifactId>" + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<source>1.5</source>" + NL + "\t\t\t\t\t<target>1.5</target>" + NL + "\t\t\t\t</configuration>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-surefire-plugin</artifactId>" + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<skip>false</skip>" + NL + "\t\t\t\t\t<disableXmlReport>false</disableXmlReport>" + NL + "\t\t\t\t\t<argLine>-Xms512m -Xmx1024m -XX:MaxPermSize=128m</argLine>" + NL + "\t\t\t\t\t<systemProperties>" + NL + "\t\t\t\t\t\t<property>" + NL + "\t\t\t\t\t\t\t<name>hibernate.search.default.indexBase</name>" + NL + "\t\t\t\t\t\t\t<value>./target/indexes</value>" + NL + "\t\t\t\t\t\t</property>" + NL + "\t\t\t\t\t</systemProperties>" + NL + "\t\t\t\t</configuration>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-ejb-plugin</artifactId>" + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<generateClient>true</generateClient>" + NL + "\t\t\t\t\t<ejbVersion>3.0</ejbVersion>" + NL + "\t\t\t\t\t<clientExcludes>" + NL + "\t\t\t\t\t\t<clientExclude>**/editor/*.class</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/*Bean*.class</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/*MDB*.class</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/*Job.class</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/package.html</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/*.xml</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/*.xhtml</clientExclude>" + NL + "\t\t\t\t\t\t<clientExclude>**/*.properties</clientExclude>" + NL + "\t\t\t\t\t</clientExcludes>" + NL + "\t\t\t\t</configuration>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.codehaus.mojo</groupId>" + NL + "\t\t\t\t<artifactId>dashboard-maven-plugin</artifactId>" + NL + "\t\t\t\t<dependencies>" + NL + "\t\t\t\t\t<dependency>" + NL + "\t\t\t\t\t\t<groupId>hsqldb</groupId>" + NL + "\t\t\t\t\t\t<artifactId>hsqldb</artifactId>" + NL + "\t\t\t\t\t\t<version>1.8.0</version>" + NL + "\t\t\t\t\t</dependency>" + NL + "\t\t\t\t</dependencies> " + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<dialect>org.hibernate.dialect.HSQLDialect</dialect>" + NL + "\t\t\t\t\t<driverClass>org.hsqldb.jdbcDriver</driverClass>" + NL + "\t\t\t\t\t<connectionUrl>jdbc:hsqldb:c:/dashboard-db/dashboardDB;create=true</connectionUrl>" + NL + "\t\t\t\t\t<username>dashboard</username>" + NL + "\t\t\t\t\t<password>dashboard</password>" + NL + "\t\t\t\t</configuration>" + NL + "\t\t\t</plugin>" + NL + "\t\t </plugins>" + NL + "\t</build>" + NL + "\t<repositories>" + NL + "\t\t<repository>" + NL + "\t\t\t<id>repo1</id>" + NL + "\t\t\t<name>Maven Repository</name>" + NL + "\t\t\t<url>http://repo1.maven.org/maven2</url>" + NL + "\t\t</repository>" + NL + "\t\t<repository>" + NL + "\t\t\t<id>jboss</id>" + NL + "\t\t\t<name>JBoss Repository</name>" + NL + "\t\t\t<url>http://repository.jboss.org/maven2</url>" + NL + "\t\t</repository>" + NL + "\t\t<repository>" + NL + "\t\t\t<id>jboss-snap</id>" + NL + "\t\t\t<name>JBoss Repository Snap</name>" + NL + "\t\t\t<url>http://snapshots.jboss.org/maven2</url>" + NL + "\t\t\t<releases>" + NL + "\t\t\t\t<enabled>false</enabled>" + NL + "\t\t\t</releases>" + NL + "\t\t\t<snapshots>" + NL + "\t\t\t\t<enabled>true</enabled>" + NL + "\t\t\t\t<updatePolicy>always</updatePolicy>" + NL + "\t\t\t</snapshots>" + NL + "\t\t</repository>" + NL + "\t\t<repository>" + NL + "\t\t\t<id>jboss-public-repository-group</id>" + NL + "\t\t\t<name>JBoss Public Repository Group</name>" + NL + "\t\t\t<url>http://repository.jboss.org/nexus/content/groups/public</url>" + NL + "\t\t\t<layout>default</layout>" + NL + "\t\t\t<releases>" + NL + "\t\t\t\t<enabled>true</enabled>" + NL + "\t\t\t\t<updatePolicy>never</updatePolicy>" + NL + "\t\t\t</releases>" + NL + "\t\t\t<snapshots>" + NL + "\t\t\t\t<enabled>true</enabled>" + NL + "\t\t\t\t<updatePolicy>never</updatePolicy>" + NL + "\t\t\t</snapshots>" + NL + "\t\t </repository>" + NL + " \t\t<repository>" + NL + "\t\t\t<id>ibiblio</id>" + NL + "\t\t\t<name>Ibiblio Repository</name>" + NL + "\t\t\t<url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>" + NL + "\t\t</repository>" + NL + "\t</repositories>" + NL + "\t<pluginRepositories>" + NL + "\t\t<pluginRepository>" + NL + "\t\t\t<id>Codehaus repository</id>" + NL + "\t\t\t<url>http://repository.codehaus.org</url>" + NL + "\t\t</pluginRepository>" + NL + "\t</pluginRepositories>" + NL + "" + NL + "<!-- Instructions: http://www.javaworld.com/javaworld/jw-02-2006/jw-0227-maven_p.html" + NL + "\t<url>http://your.project.url</url>" + NL + "\t<scm>" + NL + "\t\t<connection>scm:svn:http://svn.wakaleo.com/hoteldatabase/</connection>" + NL + "\t\t<developerConnection>scm:svn:http://svn.wakaleo.com/hoteldatabase/</developerConnection>" + NL + "\t\t<url>http://svn.wakaleo.com/viewcvs.cgi/hoteldatabase/</url>" + NL + "\t</scm>\t" + NL + "\t<ciManagement>" + NL + "\t\t<system>Continuum</system>" + NL + "\t\t<url>http://integrationserver.wakaleo.com/continuum</url>" + NL + "\t\t<notifiers>" + NL + "\t\t\t<notifier>" + NL + "\t\t\t\t<type>mail</type>" + NL + "\t\t\t\t<address>duke@wakaleo.com</address>" + NL + "\t\t\t</notifier>" + NL + "\t\t</notifiers>" + NL + "\t</ciManagement>" + NL + "\t<issueManagement>" + NL + "\t\t<system>Bugzilla</system>" + NL + "\t\t<url>https://bugzilla.wakaleo.com/</url>" + NL + "\t</issueManagement>\t " + NL + "\t<developers>" + NL + "\t\t<developer>" + NL + "\t\t\t<id>duke</id>" + NL + "\t\t\t<name>Duke Java</name>" + NL + "\t\t\t<email>duke@wakaleo.com</email>" + NL + "\t\t\t<roles>" + NL + "\t\t\t\t<role>Project Manager</role>" + NL + "\t\t\t\t<role>Architect</role>" + NL + "\t\t\t</roles>" + NL + "\t\t\t<organization>Acme.com</organization>" + NL + "\t\t\t<timezone>-5</timezone>" + NL + "\t\t </developer>\t\t  " + NL + "\t</developers>" + NL + "\t<mailingLists>" + NL + "\t  <mailingList>" + NL + "\t\t <name>HotelDatabase project mailing list</name>" + NL + "\t\t <subscribe>dev-subscribe@wakaleo.com</subscribe>" + NL + "\t\t <unsubscribe>dev-unsubscribe@wakaleo.com</unsubscribe>" + NL + "\t\t<post>dev@wakaleo.com</post>" + NL + "\t\t<archive>http://mail-archives.wakaleo.com/modmbox/dev/</archive>" + NL + "\t  </mailingList>" + NL + "\t</mailingLists>" + NL + "-->" + NL + "\t<distributionManagement> <!-- mvn clean install site-deploy -->" + NL + "\t\t<site>" + NL + "\t\t\t<id>website</id>" + NL + "\t\t\t<url>file:c:/fullsite</url>" + NL + "\t\t</site>" + NL + "\t</distributionManagement> " + NL + "\t<reporting>" + NL + "\t\t<plugins>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-javadoc-plugin</artifactId>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-jxr-plugin</artifactId>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-surefire-report-plugin</artifactId>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.codehaus.mojo</groupId>" + NL + "\t\t\t\t<artifactId>cobertura-maven-plugin</artifactId>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.codehaus.mojo</groupId>" + NL + "\t\t\t\t<artifactId>taglist-maven-plugin</artifactId>" + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<tags>" + NL + "\t\t\t\t\t\t<tag>TODO</tag>" + NL + "\t\t\t\t\t\t<tag>FIXME</tag>" + NL + "\t\t\t\t\t\t<tag>@todo</tag>" + NL + "\t\t\t\t\t\t<tag>@deprecated</tag>" + NL + "\t\t\t\t\t\t<tag>@NOT generated</tag>" + NL + "\t\t\t\t\t</tags>" + NL + "\t\t\t\t</configuration>\t\t\t\t" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-checkstyle-plugin</artifactId>" + NL + "\t\t\t\t<configuration>" + NL + "          \t\t\t<configLocation>../checkstyle/sun_checks_eclipse.xml</configLocation>" + NL + "       \t\t\t</configuration>\t\t    " + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.codehaus.mojo</groupId>" + NL + "\t\t\t\t<artifactId>dashboard-maven-plugin</artifactId>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t" + NL + "\t\t\t<!-- consider using these" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.apache.maven.plugins</groupId>" + NL + "\t\t\t\t<artifactId>maven-pmd-plugin</artifactId>" + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<targetjdk>1.5</targetjdk>" + NL + "\t\t\t\t\t<rulesets>" + NL + "\t\t\t\t\t\t<ruleset>/rulesets/basic.xml</ruleset>" + NL + "\t\t\t\t\t\t<ruleset>/rulesets/controversial.xml</ruleset>" + NL + "\t\t\t\t\t</rulesets>" + NL + "\t\t\t\t\t<format>xml</format>" + NL + "\t\t\t\t\t<linkXref>true</linkXref>" + NL + "\t\t\t\t\t<sourceEncoding>utf-8</sourceEncoding>" + NL + "\t\t\t\t\t<minimumTokens>100</minimumTokens>" + NL + "\t\t\t\t</configuration>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.codehaus.mojo</groupId>" + NL + "\t\t\t\t<artifactId>changelog-maven-plugin</artifactId>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t<plugin>" + NL + "\t\t\t\t<groupId>org.codehaus.mojo</groupId>" + NL + "\t\t\t\t<artifactId>changes-maven-plugin</artifactId>" + NL + "\t\t\t\t<reportSets>" + NL + "\t\t\t\t  <reportSet>" + NL + "\t\t\t\t\t <reports>" + NL + "\t\t\t\t\t\t<report>changes-report</report>" + NL + "\t\t\t\t\t </reports>" + NL + "\t\t\t\t  </reportSet>" + NL + "\t\t\t\t</reportSets>" + NL + "\t\t\t\t<configuration>" + NL + "\t\t\t\t\t<xmlPath>${basedir}/src/site/changes/changes.xml</xmlPath>" + NL + "\t\t\t\t</configuration>" + NL + "\t\t\t</plugin>" + NL + "\t\t\t-->" + NL + "\t\t</plugins>" + NL + "\t</reporting>" + NL + "</project>";
  protected final String TEXT_12 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    Model uml2Model = (Model) argument;
    stringBuffer.append(TEXT_1);
    stringBuffer.append(MavenHelper.getGroupId(uml2Model));
    stringBuffer.append(TEXT_2);
    stringBuffer.append(MavenHelper.getArtifactId(uml2Model, "master"));
    stringBuffer.append(TEXT_3);
    stringBuffer.append(MavenHelper.getVersion(uml2Model));
    stringBuffer.append(TEXT_4);
    stringBuffer.append(MavenHelper.getName(uml2Model, "Master"));
    stringBuffer.append(TEXT_5);
    stringBuffer.append(uml2Model.getName());
    stringBuffer.append(TEXT_6);
    stringBuffer.append(MavenHelper.getArtifactId(uml2Model, "jpa"));
    stringBuffer.append(TEXT_7);
    stringBuffer.append(MavenHelper.getArtifactId(uml2Model, "ejb"));
    stringBuffer.append(TEXT_8);
    stringBuffer.append(MavenHelper.getArtifactId(uml2Model, "jsf"));
    stringBuffer.append(TEXT_9);
    stringBuffer.append(MavenHelper.getArtifactId(uml2Model, "web"));
    stringBuffer.append(TEXT_10);
    stringBuffer.append(MavenHelper.getArtifactId(uml2Model, "app"));
    stringBuffer.append(TEXT_11);
    stringBuffer.append(TEXT_12);
    return stringBuffer.toString();
  }
}
